﻿#ifndef MUSICSLIDER_H
#define MUSICSLIDER_H

#include <QWidget>
#include <QMouseEvent>

namespace Ui {
class MusicSlider;
}

class MusicSlider : public QWidget
{
    Q_OBJECT

public:
    explicit MusicSlider(QWidget *parent = 0);
    ~MusicSlider();

    void mousePressEvent(QMouseEvent *event); // 重写⿏标按下事件
    void mouseMoveEvent(QMouseEvent *event); // 重写⿏标滚动事件
    void mouseReleaseEvent(QMouseEvent *event); // 重写⿏标释放事件

    void moveSilder(); // 修改outLine的宽度为currentPos

    void setStep(float bf);
signals:
    void setMusicSliderPosition(float ratio);
private:
    Ui::MusicSlider *ui;

    int currentPos; //滑动条当前的位置
    int maxWidth;
};

#endif // MUSICSLIDER_H
